﻿using System;

namespace DataMonitor.Model
{
    public abstract class MonitorBase
    {
        public event Func<byte[], string> ReceiveEvent;
        public Action<string> ShowMsgAction; 

        protected virtual string OnReceiveEvent(byte[] obj)
        {
            var handler = ReceiveEvent;
            return handler != null ? handler(obj) : string.Empty;
        }

        public abstract bool Send(byte[] buffer);
    }
}
